package fun.boomcat.luckyhe.mirai.plugin.command.utils;

public class ReplySentenceHandler {

    public static String convertToOrigin(String escaped) {
//        将自定义\s\n转换成真的\s\n
        String res = escaped.replaceAll("(?<=[^\\\\])\\\\n", "\n");
        res = res.replaceAll("(?<=[^\\\\])\\\\s", " ");
        return res;
    }

    public static String convertToEscaped(String origin) {
//        将真的\s\n转换成自定义的\s\n
        String res = origin.replaceAll(" ", "\\s");
        res = res.replaceAll("\\n", "\\n");
        return res;
    }

}
